import { createRouter, createWebHashHistory } from 'vue-router'

const router = createRouter({
  history: createWebHashHistory(), // hash模式：createWebHashHistory，history模式：createWebHistory
  routes: [
    {
      path: '/',
      redirect: '/introduce'
    },
    {
      path: '/login',
      name: 'login',
      component: () => import('../views/Login.vue')
    },
    {
      path: '/introduce',
      name: 'introduce',
      component: () => import('../views/Introduce.vue')
    },
    {
      path: '/posts',
      name: 'posts',
      component: () => import('../views/Posts.vue')
    },
    {
      path: '/comments',
      name: 'comments',
      component: () => import('../views/comments.vue')
    },
    {
      path: '/topics',
      name: 'topics',
      component: () => import('../views/topics.vue')
    },
    {
      path:'/users',
      name:'users',
      component:()=>import("../views/Users.vue")
    },
    {
      path: '/addUser',
      name: 'addUser',
      component: () => import('../views/AddUser.vue')
    },
    {
      path:'/categories',
      name:'categories',
      component:()=>import('../views/Categories.vue')
    },
    {
      path:'/specs',
      name:'specs',
      component:()=>import('../views/Specs.vue')
    },
    {
      path:'/spus',
      name:'spus',
      component:()=>import('../views/Spus.vue')
    },
    {
      path:'/skus',
      name:'skus',
      component:()=>import('../views/Skus.vue')
    },
    {
      path:'/orders',
      name:'orders',
      component:()=>import('../views/Orders.vue')
    },
    {
      path: '/order_detail',
      name: 'order_detail',
      component: () => import(/* webpackChunkName: "order_detail" */ '../views/OrderDetail.vue')
    },
    {
      path:'/addSpu',
      name:'addSpu',
      component:()=>import('../views/AddSpu.vue')
    },
    {
      path:'/changePwd',
      name:'changePwd',
      component:()=>import('../views/ChangePwd.vue')
    }
  ]
})

export default router